package actions;

import gui.GUIWindow;

import java.awt.MenuItem;

import javax.swing.AbstractAction;
import javax.swing.Action;



public abstract class SysTrayAbstractAction extends AbstractAction  {

	private GUIWindow owner;
	
	private MenuItem item;
	
	public void setActionOwner(GUIWindow owner) {
		this.owner = owner;
	}
	
	public GUIWindow getActionOwner() {
		return this.owner;
	}

	
	public void setActionItem() {
		item = new MenuItem((String) this.getValue(Action.NAME));
		
		item.addActionListener(this);
	}
	
	
	@Override
	public void setEnabled(boolean newValue) {
		super.setEnabled(newValue);
		
		if (item != null)
			item.setEnabled(newValue);
	}

	
	public MenuItem getItem() {
		return this.item;
	}
	
}
